pp108 : Using XLets in XForms

Using XLets in XForms

This topic describes the usage of XLets in an XForm.

Consider a scenario where you may need an additional functionality for an XForm in your Web application. An option can be to dynamically plug in the functionality so that you can continue to use your existing Web application with minimal changes. Process Platform XForms enables this by supporting the use of XLets.

XLets are XForms that contain the required, reusable functionality and are used as plug-ins in other XForms. XLets are plugged into an XForm using its URL.

To be able to use an XForm as an XLet, you must first create and publish the XForm. The URL of the published XLet can then be used in another XForm.

Appending XLets using the xlink parameter

In order to use an XLet in an XForm, you need to specify thexlinkparameter in the URL. The syntax for specifying thexlinkparameter is as follows.

xlink=<URL of XLet>,<position of XLet on XForm>

where, you can specify the position of the XLet on the XForm astoporbottom.
For example, consider an XLet with /buttonSnippet.caf as the URL, and an XForm (anyForm.caf) with /someFolder/anyForm.caf?organization as the URL. To append the XLet to the bottom of the XForm, you can use thexlinkparameter as follows:

/someFolder/anyForm.caf?organization='some org'&amp;xlink=/buttonSnippet.caf,bottom

This will append the button snippet to any Form.caf.
You can also attach multiple XLets to an XForm as follows.

xlink=<URL of XLet1>,<position of XLet1 on XForm>; <URL of XLet2>,<position of XLet2 on XForm>; <URL of XLet3>,<position of XLet3 on XForm>

This will append the XLets to the main page in the order specified in the xlink parameter.

Note:
Ensure that the names of all methods, event handlers, and controls are unique for each associated XLet and XForm.